import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

// vant 组件库
import Vant from 'vant'
import { Lazyload } from 'vant'
import 'vant/lib/index.css'

// dayjs
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
import relativeTime from 'dayjs/plugin/relativeTime'
dayjs.locale('zh-cn')
dayjs.extend(relativeTime)
Vue.prototype.dayjs = dayjs

// 点击反馈指令插件
import vueFeedback from 'vue-feedback'

// 注册全局组件
import CoverLazy from './components/CoverLazy'
import Empty from './components/Empty'

// 全局 css
import './styles/index.scss'

// 移动端适配插件 设置 rem 基准值
import 'amfe-flexible'

// 全局过滤器
import * as filters from './filters'
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.use(Vant)
Vue.use(Lazyload, {
  lazyComponent: true,
})
Vue.use(vueFeedback)
Vue.component('CoverLazy', CoverLazy)
Vue.component('Empty', Empty)
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
